package com.gourd.common.rbac.service;

import com.alicp.jetcache.anno.CacheInvalidate;
import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.Cached;
import com.baomidou.mybatisplus.service.IService;
import com.gourd.common.rbac.entity.RbacPermission;

import java.util.List;

/**
 * 权限
 *
 * @author gourd
 * @date 2019-04-02 17:26:16
 * Created by CodeGen .
 */
public interface RbacPermissionService extends IService<RbacPermission> {

    @Cached(name = "permissionService.findByRoleIds",cacheType = CacheType.BOTH)
    List<RbacPermission> findByRoleIds(List<Long> roleIds);

    /**
     * 删除权限
     * @return
     */
    @CacheInvalidate(name = "permissionService.delete",key="#id")
    void delete(Long id);
}